<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
function func_security_check($users_group = '', $users_gid = 0) {
	if( $users_group != '' && $_SESSION['suser']->usertype != $users_group ) {
		$_SESSION['security']['goto'] = SYS_RT_REQUEST_URI;//$request_uri
		//util_redirect('login/');
		$GLOBALS['need_login'] = 1;
	}
	if( $_SESSION['suser']->userid == 0 ) {
		$_SESSION['security']['goto'] = SYS_RT_REQUEST_URI;//$request_uri
		util_redirect('login/?goto=' . SYS_RT_REQUEST_URI);
		$GLOBALS['need_login'] = 1;
	}
}
//
?>